Description
Logical semaphores (LSMs) contain a single signed integer which can be modified by signalers. Consumers can specify keys and rules. For example, the consumer may wish to block until the semaphore value exceeds 24, or is equal to 15 and so on. These objects are primarily provided as a means of providing switching and routing logic (equivalent to conditional branching).
Creation Attributes
Name
Instance name (see Object Names)
Dimensions
Instance dimensionality (see Object Dimensionality)
Presence
Instance presence flag (see Object Presence)
Initial Value
This attribute determines the initial value that the semaphore is created with.
Connection Attributes
Logical semaphore connections require the following attributes;
Timeout
This attribute determines whether the connection will poll or block (see Connection Timeout).
Signature
This attribute is a string that describes the mapping from elements in the consumer, to elements in the providing semaphore. See Connection Mappings.
Dimensions
This attribute determines the dimensionality of the connection array owned by each consuming element. By default, this will provide the consuming element with one connection for each provider element. Collector, Multiplexor and Manual connection consumers can have multi-dimensional connection arrays, but in all other cases, this attribute will be '1'. See Connection Mappings.
Repeat Count
This attribute determines the number of times that each 'provider element to consumer element' connection is repeated. If the repeat count is greater then one, then the Dimensions attribute (above), and the resulting connection access functions, will both have an 'extra' dimension. Only Collector, Multiplexor and Manual connection consumers can have repeat counts that are greater than '1'. See Connection Mappings.
Name
This attribute determines the connection's 'name' which is used to construct access function names (see Connection Names).
Access
This attribute determines whether the consumer is requesting or signaling.
Key1
This attribute is used by requesting and signaling cases and is described in detail in the LSM request function and LSM signal function topics respectively.
Key2
This attribute is used by requesting and signaling cases and is described in detail in the LSM request function and LSM signal function topics respectively.
Rule
This attribute is used by requesting and signaling cases and is described in detail in the LSM request function and LSM signal function topics respectively.
Additional attributes may also be required that are specific to the connection's consuming object. These are documented in their respective sections.
Manual Connections
Manual connections provide a means of directly accessing target objects. These are created automatically from CDL diagrams and accessed using their access function names (see Manual Connections).
Counting semaphore connections provide the following member functions;
Request()
This member function issues a request to the counting semaphore (see LSM request function).
Signal()
This member function signals the counting semaphore (see LSM signal function).
Automatic and Manual Connections
The following member functions can be used to retrieve information from both automatic and manual connections;
IsOpen()
This member function returns TRUE if the connection is 'Open' or FALSE otherwise.
Key()
Following a successful request, this member function returns the current semaphore value.
Example
See Event Routing.